<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>借款用户管理</title>

<link href="../tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../Js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../Js/haidao.offcial.general.js"></script>
<script type="text/javascript" src="../Js/select.js"></script>
<script type="text/javascript" src="../Js/haidao.validate.js"></script>
<script src="../My97DatePicker/WdatePicker.js"></script>
<script type="../tablecloth/tablecloth.js"></script>

<script type="text/javascript">
	var uid = 0;
</script>

<script type="text/javascript">
$(function(){init();});
function init() {
	var page = parseInt(document.form1.currentPage.value);
	var pageCount = parseInt(document.form1.pageCount.value);
	var count=parseInt(document.form1.count.value);
	if (page == 1 && pageCount!=1) {
		document.form1.pre1.disabled = "disabled";
		return;
	}
	if (page == count && pageCount!=1) {
		document.form1.next1.disabled = "disabled";
		return;
	}
	if (pageCount == 1) {
		document.form1.pre1.disabled = "disabled";
		document.form1.next1.disabled = "disabled";
		document.form1.first1.disabled = "disabled";
		document.form1.end1.disabled = "disabled";
		return;
	}
} 

function first() {
	window.location.href = "<%=request.getContextPath()%>/user/info.do?currentPage=1" + getQueryData();
	
}

function next() {
	var page = parseInt(document.form1.currentPage.value);
	window.location.href = "<%=request.getContextPath()%>/user/info.do?currentPage=" + (page + 1) + getQueryData();
}

function pre() {
	var page = parseInt(document.form1.currentPage.value);
	window.location.href = "<%=request.getContextPath()%>/user/info.do?currentPage=" + (page - 1) + getQueryData();
}

function end() {
	var pageCount = parseInt(document.form1.pageCount.value);
	window.location.href = "<%=request.getContextPath()%>/user/info.do?currentPage=" + pageCount + getQueryData();
}
//拼接查询条件
function getQueryData(){
	var userNumber=$("#userNumber").val();
	var userName=$("#userName").val();
	var phoneNumber=$("#phoneNumber").val();
	var registerTimeStart=$("#registerTimeStart").val();
	var registerTimeEnd=$("#registerTimeEnd").val();
	var register=$("#register").val();
	var channelList=$("#channelList").val();
	var queryper="&userNumber="+userNumber+"&userName="+userName+"&phoneNumber="+phoneNumber+"&registerTimeStart="+registerTimeStart
	+"&registerTimeEnd="+registerTimeEnd+"&register="+register+"&channelList="+channelList;
	return queryper;
	}

</script>

</head>
<body>
	<div>
		<div class="view-product">
			<div class="message-manage">
				<div class="manage-record margin-lr">
				<form name="form1" method="get" action="<%=request.getContextPath()%>/user/info.do">
					<table border="0">
					    <tr><td>
						用户编号： <input type="text" name="userNumber" id="userNumber" size="15" value="${userNumber}">&nbsp;&nbsp;
						名称： <input type="text" name="userName" id="userName" size="15" value="${userName}">&nbsp;&nbsp;
						登录账号： <input type="text" name="phoneNumber" id="phoneNumber" size="15" value="${phoneNumber}">&nbsp;&nbsp;
						注册时间： <input type="text" name="registerTimeStart" id="registerTimeStart" size="20"
						                value="${registerTimeStart}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">&nbsp;
							     至  <input type="text" name="registerTimeEnd" id="registerTimeEnd" size="20" 
							           value="${registerTimeEnd}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">&nbsp;&nbsp;
			    		注册来源：<select name="register" id="register" >
						       <option value="">请选择</option>
						       <c:forEach items="${register}" var="u">
									<c:choose>
										<c:when test="${u.register == register2}">
											<option value="${u.register}" selected="selected">${u.register}</option>
											</c:when>
											<c:otherwise>
												<option value="${u.register}">${u.register}</option>
											</c:otherwise>
										 </c:choose>
								     </c:forEach>
								</select>&nbsp;&nbsp;
						渠道编号：<select name="channelList" id="channelList" >
						             <option value="">请选择</option>
						             <c:forEach items="${channelList}" var="c">
										<c:choose>
											<c:when test="${c.channelname == channel}">
											    <option value="${c.channelname}" selected="selected">${c.channelname}</option>
											</c:when>
											<c:otherwise>
												<option value="${c.channelname}">${c.channelname}</option>
											</c:otherwise>
										</c:choose>
								     </c:forEach>
								 </select>&nbsp;&nbsp;
						<input type="submit" id="addAction" value="筛选">&nbsp;&nbsp;
			            </td>
			            </tr>
					</table>
				
					<div class="offcial-table margin-top clearfix">
						<div class="tr-th clearfix">
							<table width="100%" border="0">
								<thead>
									<tr>
										<th>用户编号</th>
										<th>名称</th>
										<th>登录账号</th>
										<th>注册时间</th>
										<th>注册来源</th>
										<th>渠道编号</th>
										<th>借款申请中(元)</th>
										<th>在贷金额(元)</th>
										<th>资金状态</th>
										<th>用户属性</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${list}" var="u">
										<tr style="white-space: nowrap;">
											<td>${u.userNumber}</td>
											<td>${u.userName}</td>
											<td>${u.phoneNumber}</td>
											<td>${u.logtime}</td>
											<td>${u.source}</td>
											<td>${u.channel}</td>
											<td>${u.borrow}</td>
											<td>${u.borrowPut}</td>
											<td>正常</td>
											<td>正常</td>
											<td>${u.button}</td>
											<%-- <td align="center"><a href="<%=request.getContextPath()%>/user/personInfo.do?userNumber=${u.userNumber}">查看详情</a>
											</td> --%>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							
							<table><tbody><tr><td>
							    <input type="hidden" name="currentPage" value="${currentPage}" /> 
								<input type="hidden" name="pageCount" value="${pageCount}"/> 
								<input type="hidden" name="count" value="${count}"/>
								<input type="button" name="first1" value="首页" onclick="first()" class="button gray" /> 
								<input type="button" name="pre1" value="上一页" onclick="pre()" class="button green"/> 
								<input type="button" name="next1" value="下一页" onclick="next()" class="button blue"/> 
								<input type="button" name="end1" value="尾页" onclick="end()" class="button gray"/> 
								<font>第${currentPage}页, 共${pageCount}页,共${count}条数据</font>
							</td></tr></tbody></table>
						</div>
					</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
